Skip to content

feat!: add defineOptions factory for fetchify options - #2

Merged
joeykamsteeg merged 1 commit into
developfrom
feature/define-options-pattern
Aug 1, 2026
Merged

feat!: add defineOptions factory for fetchify options#2
joeykamsteeg merged 1 commit into
developfrom
feature/define-options-pattern

Conversation

@joeykamsteeg

Copy link
Copy Markdown
Member

Summary

  • Add defineOptions(options: FetchifyOptions): FetchifyOptions, a typed entry point for authoring fetchify options independently of createFetchify (mirrors the defineConfig pattern from Vite/Vue).
  • BREAKING: rename CreateFetchifyOptions to FetchifyOptions, the shared type now used by both defineOptions and createFetchify.
  • Export defineOptions and FetchifyOptions from both the fetchify and fetchify/native entry points.
const options = defineOptions({ baseUrl: new URL("https://api.packetify.app") });
const http = createFetchify(options);
const response = http.GET("/users");

Implements the define-fetchify-options OpenSpec change (archived at openspec/changes/archive/2026-08-02-define-fetchify-options/); main specs fetchify-options and http-client updated accordingly. Changeset included (minor, package is unreleased/private at 0.0.0).

Test plan

  • bun test — 27 pass, 0 fail
  • bun run build — builds cleanly, dist/lib/define-options.d.ts generated with no type errors

🤖 Generated with Claude Code

Introduces defineOptions, a typed entry point for authoring FetchifyOptions
independently of createFetchify, mirroring the defineConfig pattern used by
tools like Vite and Vue.

BREAKING CHANGE: CreateFetchifyOptions has been renamed to FetchifyOptions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@joeykamsteeg
joeykamsteeg merged commit 7961879 into develop Aug 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant